﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using System.Drawing;
using System.IO;
using System.Xml;
using System.Data;
using System.Data.OleDb;

namespace KoPages.CONTROLTEMPLATES.Ko
{
    public partial class Test : UserControl
    {

        #region Members
        public enum ALIGNMENT { left = 1, right = 2 };
        #endregion
        #region Properties
        private Color _BORDER_COLOR = Color.FromArgb(204, 204, 204); // "#cccccc"
        public Color BORDER_COLOR
        {
            get { return _BORDER_COLOR; }
            set { _BORDER_COLOR = value; }
        }
        #endregion Properties

        protected void Page_Load(object sender, EventArgs e)
        {
            //XmlDocument xReturn = getXML();
        }

        public string GetTestStr()
        {
            return @"<div> <SPAN class=ms-splinkbutton-text>Корзина</SPAN> </div>";
        }

        public XmlDocument getXML()
        {
            XmlDocument xReturn = new XmlDocument();
            DataSet result = new DataSet("MyDataSet Name");

            DataTable tbl = new DataTable("tbl");
            tbl.Columns.Add("id");
            tbl.Columns.Add("name");

            DataRow item = tbl.NewRow();
            item["id"] = 1;
            item["name"] = "MyName";
            tbl.Rows.Add(item);

            DataRow item2 = tbl.NewRow();
            item2["id"] = 2;
            item2["name"] = "MyName 2";
            tbl.Rows.Add(item2);

            StringWriter stringWriter = new StringWriter();
            XmlTextWriter xmlTextwriter = new XmlTextWriter(stringWriter);
            tbl.WriteXml(xmlTextwriter, XmlWriteMode.WriteSchema);
            XmlNode xRoot = xReturn.CreateElement("root");
            xReturn.AppendChild(xRoot);
            xReturn.LoadXml(stringWriter.ToString());

            return xReturn;
        }

    }
}
